<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Vue & Sensors SDK</title>
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
  </head>
  <body>
    <div id="app">
      <p>
      <div id="theBtn">Sensors Deeplink Hello App!</div>
      </p>
      <p>
        <!-- use router-link component for navigation. -->
        <!-- specify the link by passing the `to` prop. -->
        <!-- `<router-link>` will be rendered as an `<a>` tag by default -->
<!--        <router-link to="/foo">Go to Foo</router-link>-->
<!--        <router-link to="/bar">Go to Bar</router-link>-->
      </p>
      <!-- route outlet -->
      <!-- component matched by the route will render here -->
      <router-view></router-view>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue-router@3.0.6/dist/vue-router.min.js"></script>
<!--    <script src="autotrack.js"></script>-->
    <script src="index.js"></script>
    <script src="https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>
    <script>
      // 初始化
      var vConsole = new VConsole();
      console.log('Hello world');
    </script>

    <script charset="UTF-8" src="https://cdn.jsdelivr.net/npm/sa-sdk-javascript@1.19.11/sensorsdata.min.js"></script>
    <script charset="UTF-8">
      var sensors = window['sensorsDataAnalytic201505'];
      sensors.init({
        server_url: 'https://applog.ctsec.com/sa',
        heatmap:{scroll_notice_map:'not_collect'},
        is_track_single_page:true,
        use_client_time:true,
        send_type:'beacon',
        show_log:true
      });

      console.log('autoTrack');
      sensors.quick('autoTrack');

      // 初始化深度链接插件
      sensors.quick('useAppPlugin', {
              deeplink: function(deeplink) {
                deeplink.init({timeout: 2900}); // 等待唤起 App 的时间，默认 3000 ms
                document.getElementById('theBtn').addEventListener('click', function(e) {
                  console.log('click');
                  e.preventDefault();
                  deeplink.openDeepLink();
                });
              }
      });

      </script>
  </body>
</html>